home *** CD-ROM | disk | FTP | other *** search
/ Gamers Delight 2 / Gamers Delight 2.iso / Aminet / game / board / GNUChess4_0_58.lha / gnuchess-4.0 / src / Makefile.0 < prev    next >
Makefile  |  1992-08-26  |  13KB  |  323 lines

  1. #
  2. # Makefile for GNU Chess
  3. #
  4. # Copyright (c) 1992 Free Software Foundation
  5. #
  6. # This file is part of GNU CHESS.
  7. #
  8. # GNU Chess is free software; you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation; either version 2, or (at your option)
  11. # any later version.
  12. #
  13. # GNU Chess is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with GNU Chess; see the file COPYING.  If not, write to
  20. # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21. #
  22.  
  23. #
  24. # gnuchess  is a curses-based chess.
  25. # gnuchessn is a fancy-display-curses-based chess.
  26. # gnuchessr is a plain dumb-terminal chess (but with full variation output)
  27. # gnuchessc is suitable for chesstool use (mimics /usr/games/chess output)
  28. # gnuchessx is the xchess based chess.
  29. #
  30.  
  31. # The version number of this GNU and Xboard release
  32. VERS=    4.0
  33. XVERS = 2.0
  34.  
  35. # Relevant file areas.
  36. DIST=    ../README ../README.lang ../doc ../misc ../src ../test
  37.  
  38. # Distribution directory
  39. DISTDIR=/tmp_mnt/home/fsf/cracraft/Ch
  40.  
  41. # Programs being distributed
  42. PROGS=gnuchess-$(VERS) xboard-$(XVERS)
  43. #PROGS=gnuchess-$(VERS)
  44.  
  45. # Change these to something less transitory, like /usr/games, and then
  46. # compile. Ask your system admin / unix guru to put gnuchess.{hash,lang,book}
  47. # in $(LIBDIR).
  48. # Where the binaries live.
  49. BINDIR= /tmp_mnt/home/fsf/cracraft/Ch
  50.  
  51. # Where language description, our book, and the persistent hash live.
  52. LIBDIR= /tmp
  53.  
  54. # Display routines.
  55. LCURSES=-lcurses -ltermcap
  56.  
  57. #compile options for gnuchess
  58. # -DAG[0-4]  selects a set of values for SpaceBonus tables
  59. # -DQUIETBACKGROUND don't print post information in background ( easy OFF)
  60. # -DNOMEMSET if your machine does not support memset
  61. # -DNOMATERIAL don't call it a draw when no pawns and both sides < rook
  62. # -DNODYNALPHA don't dynamically adjust alpha
  63. # -DHISTORY use history killer hueristic 
  64. # -DKILLT use killt killer hueristic 
  65. # -DNOSCORESPACE don't use Scorespace heuristic
  66. # -DOLDXBOARD don't generate underpromote moves
  67. # -DGNU3 don't generate underpromote moves
  68. # -DLONG64 if you have 64bit longs
  69. # -DSYSV   if you are using SYSV
  70. # some debug options
  71. # -DDEBUG8 dump board,movelist,input move to /tmp/DEBUG if illegal move
  72. # -DDEBUG9 dump move list from test command
  73. # -DDEBUG10 dump board and move after search before !easy begins
  74. # -DDEBUG11 dump board when the move is output
  75. # -DDEBUG12 dump boards between moves
  76. # -DDEBUG13 dump search control information for each move to /tmp/DEBUG
  77. # -DDEBUG40 include extra values of variables for debugging  in game list
  78. # the rest of the debug options are tied to the debuglevel command
  79. # -DDEBUG -DDEBUG4 set up code for debuglevel command
  80. #          debuglevel
  81. #               1 always force evaluation in evaluate
  82. #               4 print move list after search
  83. #               8 print move list after book before search
  84. #              16 print move list after each ply of search
  85. #              32 print adds to transposition table
  86. #              64 print returns from transposition table lookups
  87. #          256 print search tree as it is generated
  88.  
  89.  
  90. OPT= -DAG4 -DQUIETBACKGROUND -DNOSCORESPACE -DHISTORY
  91.  
  92. # The hashfile is a record of positions seen. It is used by
  93. # GNU Chess to avoid making the same mistakes, a form of learning.
  94. HASH=    -DHASHFILE=\"$(LIBDIR)/gnuchess.hash\"
  95.  
  96. # The "book" is a record of the first few moves, for playing good
  97. # moves easily and quickly, saving time, and irritating the human
  98. # opponent.
  99. BOOK=    -DBOOK=\"$(LIBDIR)/gnuchess.book\"
  100. #BINBOOK = -DBINBOOK=\"$(LIBDIR)/gnuchess.book.data\"
  101.  
  102. # The language file describes capabilities of the program. Perhaps
  103. # it is useful for non-English speaking countries and customizing
  104. # for their convenience and chess happiness.
  105. LANG= -DLANGFILE=\"$(LIBDIR)/gnuchess.lang\"
  106.  
  107. # The compiler used for compiling this software.
  108. # Use this for a plain C compiler 
  109. #CC= cc $(OPT)
  110. # Use this for DEC's ANSI C compiler on Ultrix
  111. #CC= c89 $(OPT)
  112. # Use this if you are lucky enough to have GNU CC.
  113. CC=    gcc -W $(OPT)
  114. #CC=    /contrib/system/bin/gcc -W $(OPT)
  115.  
  116. # Miscellaneous CFLAGS. Uncomment the one you need and comment 
  117. # the other.
  118. #CFLAGS= -p -Dinline=""     -traditional-cpp
  119. #CFLAGS= -O4 -Qpath .  # SunOS cc using unprotoize
  120. #CFLAGS= -O4 # Sun acc
  121. #CFLAGS= -g  # debug
  122. #CFLAGS= -O2 # DEC ANSI C (c89) on Ultrix.
  123. #CFLAGS= +O3 -Aa -D_HPUX_SOURCE -DSYSV # HPUX cc 
  124. #CFLAGS= -O   -finline-functions -fstrength-reduce -D__mips -D__LANGUAGE_C # gnu cc 1.40 on DS5000
  125. #CFLAGS= -O   -finline-functions -fstrength-reduce  # gnu cc 1.40 on others
  126. #CFLAGS= -O2 -funroll-loops -D__mips -D__LANGUAGE_C # gnu cc 2.00 on DS5000
  127. CFLAGS= -O2 -funroll-loops -traditional-cpp  # gnu cc  2.00 on SunOS
  128. #CFLAGS= -O2 -funroll-loops  # gnu cc  2.00 on others
  129.  
  130. all : gnuchess gnuchessr gnuchessn gnuchessx gnuchessc postprint gnuan game checkbook checkgame
  131.  
  132. gnuchess: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o
  133.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchess mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o uxdsp.o $(LCURSES)
  134.  
  135. gnuan: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o
  136.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuan mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o gnuan.o
  137.  
  138. gnuchessc: mainC.o bookC.o genmovesC.o ataks.o util.o evalN.o init.o searchC.o dspcomC.o nondspC.o
  139.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessc mainC.o bookC.o genmovesC.o ataks.o util.o evalN.o init.o searchC.o dspcomC.o nondspC.o
  140.  
  141. Dgnuchessr: mainDR.o bookN.o genmovesN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o
  142.     $(CC)  -DDEBUG  -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessr mainDR.o bookN.o genmovesN.o ataks.o utilDR.o evalDR.o init.o searchDR.o dspcomDR.o nondspDR.o
  143.  
  144. gnuchessx: mainX.o bookX.o genmovesX.o ataks.o util.o evalN.o init.o searchX.o dspcomX.o nondspX.o
  145.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessx mainX.o bookX.o genmovesX.o ataks.o util.o evalN.o init.o searchX.o dspcomX.o nondspX.o
  146.  
  147. gnuchessr: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  148.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessr mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomR.o nondspR.o
  149.  
  150. gnuchessn: mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o
  151.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -o gnuchessn mainN.o bookN.o genmovesN.o ataks.o util.o evalN.o init.o searchN.o dspcomN.o nuxdsp.o $(LCURSES)
  152.     
  153. game: game.c gnuchess.h
  154.     $(CC) $(CFLAGS) -o game game.c
  155.     
  156. postprint: postprint.o
  157.     $(CC) $(CFLAGS) -o postprint postprint.o
  158.     
  159. checkbook: checkbook.o
  160.     $(CC) $(CFLAGS) -o checkbook checkbook.o
  161.     
  162. checkgame: checkgame.o
  163.     $(CC) $(CFLAGS) -o checkgame checkgame.o
  164.  
  165. gnuan.o: gnuan.c gnuchess.h version.h
  166.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c gnuan.c
  167.  
  168. mainN.o: main.c gnuchess.h version.h
  169.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c main.c
  170.     mv main.o mainN.o
  171. mainC.o: main.c gnuchess.h version.h
  172.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  173.         -c main.c
  174.     mv main.o mainC.o
  175. mainX.o: main.c gnuchess.h version.h
  176.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  -c main.c
  177.     mv main.o mainX.o
  178. mainDR.o: main.c gnuchess.h version.h
  179.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  180.         -c main.c
  181.     mv main.o mainDR.o
  182.  
  183. genmovesN.o: genmoves.c gnuchess.h version.h
  184.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c genmoves.c
  185.     mv genmoves.o genmovesN.o
  186. genmovesC.o: genmoves.c gnuchess.h version.h
  187.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  188.         -c genmoves.c 
  189.     mv genmoves.o genmovesC.o
  190. genmovesX.o: genmoves.c gnuchess.h version.h
  191.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD \
  192.         -c genmoves.c
  193.     mv genmoves.o  genmovesX.o
  194.  
  195. bookN.o: book.c gnuchess.h version.h
  196.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) $(BINBOOK) -c book.c 
  197.     mv book.o bookN.o
  198. bookC.o: book.c gnuchess.h version.h
  199.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  200.           $(BINBOOK) \
  201.         -c book.c 
  202.     mv book.o bookC.o
  203. bookX.o: book.c gnuchess.h version.h
  204.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD  $(BINBOOK) \
  205.         -c book.c
  206.     mv book.o  bookX.o
  207.  
  208. ataks.o: ataks.h ataks.c gnuchess.h version.h
  209.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c ataks.c
  210.  
  211. util.o: util.c gnuchess.h version.h
  212.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c util.c
  213.  
  214. evalN.o: eval.c gnuchess.h version.h
  215.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c eval.c
  216.     mv eval.o evalN.o
  217. evalDR.o: eval.c gnuchess.h version.h
  218.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  219.         -c eval.c 
  220.     mv eval.o evalDR.o
  221. utilDR.o: util.c gnuchess.h version.h
  222.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  223.         -c util.c 
  224.     mv util.o utilDR.o
  225.  
  226. init.o: init.c gnuchess.h version.h
  227.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c init.c
  228.  
  229. searchN.o: search.c gnuchess.h version.h
  230.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c search.c
  231.     mv search.o searchN.o
  232. searchC.o: search.c gnuchess.h version.h
  233.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  234.         -c search.c 
  235.     mv search.o searchC.o
  236. searchX.o: search.c gnuchess.h version.h
  237.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DXBOARD \
  238.         -c search.c 
  239.     mv search.o searchX.o
  240. searchDR.o: search.c gnuchess.h version.h
  241.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) \
  242.         -c search.c 
  243.     mv search.o searchDR.o
  244.  
  245. uxdsp.o: uxdsp.c gnuchess.h version.h
  246.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c uxdsp.c
  247.  
  248. nuxdsp.o: nuxdsp.c gnuchess.h version.h
  249.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c nuxdsp.c
  250.  
  251. nondspC.o: nondsp.c gnuchess.h version.h
  252.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  253.         -c nondsp.c 
  254.     mv nondsp.o nondspC.o
  255. nondspX.o: nondsp.c gnuchess.h version.h
  256.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DXBOARD \
  257.         -c nondsp.c 
  258.     mv nondsp.o nondspX.o
  259. nondspR.o: nondsp.c gnuchess.h version.h
  260.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  261.         -c nondsp.c 
  262.     mv nondsp.o nondspR.o
  263. nondspDR.o: nondsp.c gnuchess.h version.h
  264.     $(CC)  -DDEBUG4 -DDEBUG $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  265.          -c nondsp.c 
  266.     mv nondsp.o nondspDR.o
  267.  
  268. dspcomN.o: dspcom.c gnuchess.h version.h
  269.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -c dspcom.c
  270.     mv dspcom.o dspcomN.o
  271. dspcomC.o: dspcom.c gnuchess.h version.h
  272.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DCHESSTOOL \
  273.         -c dspcom.c 
  274.     mv dspcom.o dspcomC.o
  275. dspcomX.o: dspcom.c gnuchess.h version.h
  276.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP -DXBOARD \
  277.         -c dspcom.c 
  278.     mv dspcom.o dspcomX.o
  279. dspcomR.o: dspcom.c gnuchess.h version.h
  280.     $(CC) $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  281.         -c dspcom.c 
  282.     mv dspcom.o dspcomR.o
  283. dspcomDR.o: dspcom.c gnuchess.h version.h
  284.     $(CC)  -DDEBUG -DDEBUG4 $(CFLAGS) $(HASH) $(LANG) $(BOOK) -DNONDSP \
  285.         -c dspcom.c 
  286.     mv dspcom.o dspcomDR.o
  287.  
  288. postprint.o: postprint.c gnuchess.h version.h
  289.     $(CC) $(CFLAGS) -c postprint.c
  290.  
  291. distribution:
  292.     -patchlevel=`cat $(DISTDIR)/gnuchess-$(VERS)/src/version.h|grep patchlevel|sed -e 's/[^0-9]//g'` ;\
  293.     echo "GNU patchlevel is $$patchlevel" ;\
  294.     xpatchlevel=`cat $(DISTDIR)/xboard-$(XVERS)/patchlevel.h|sed -e "s/#define PATCHLEVEL //"` ;\
  295.     cd $(DISTDIR) ;\
  296.     rm -f gnuchess.tar.$(VERS).Z* gnuchess.tar.$(VERS).Z.uu* ;\
  297.     tar cf - $(PROGS) | compress > $(DISTDIR)/gnuchess-$(VERS).pl$$patchlevel.tar.Z ;\
  298.     uuencode gnuchess-$(VERS).pl$$patchlevel.tar.Z gnuchess-$(VERS).pl$$patchlevel.tar.Z > gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  299.     rm -f x?? ;\
  300.     split -2500 gnuchess-$(VERS).pl$$patchlevel.tar.Z.uu ;\
  301.     for i in x??; do \
  302.       mv $$i $(DISTDIR)/GNU_Chess_$$i; \
  303.     done
  304.  
  305. install:
  306.     -cp gnuchessx $(BINDIR)/gnuchessx
  307.     -cp gnuchessc $(BINDIR)/gnuchessc
  308.     -cp gnuchessr $(BINDIR)/gnuchessr
  309.     -cp gnuchessn $(BINDIR)/gnuchessn
  310.     -cp postprint $(BINDIR)/postprint
  311.     -cp gnuan $(BINDIR)/gnuan
  312.     -cp gnuchess $(BINDIR)/gnuchess
  313.     -cp checkbook $(BINDIR)/checkbook
  314.     -cp checkgame $(BINDIR)/checkgame
  315.     -cp ../misc/gnuchess.book $(LIBDIR)/gnuchess.book
  316.     -cp ../misc/gnuchess.lang $(LIBDIR)/gnuchess.lang
  317.  
  318. clean:
  319.     -rm -f gnuchessx gnuchessc gnuchess gnuchessr gnuchessn gnuchessd postprint gnuan checkbook checkgame game
  320.     -echo $(DISTDIR)
  321.     -rm -f $(DISTDIR)/gnuchess-4.0/misc/gnuchess.book.data
  322.     -find $(DISTDIR) \( -name '*.o' -o -name '*~' -o -name 'CL*' -o -name 'PATCH*' -o -name '#*#' -o -name '%*%' -o -name '*orig' \) -exec rm -f {} \;
  323.